﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BT_web__nhom06
{
    public partial class Xoa_User : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lbltaikhoan.Text = Request.QueryString["username"];
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            int ketqua = 0;
            string username = Request.QueryString["username"];
            string lenhsql = "delete from [User] where username = @username";
            ketqua = Tienichsql.ketnoicsdl.chaylenhcapnhatdulieu(lenhsql, new string[] { "@username" }, new object[] { username });
            if (ketqua == 1)
            {
                lblthongbao.Text = "Da xoa";
                Button1.Visible = false;
                Button2.Text = "<< Quay lại";
            }
            else
                lblthongbao.Text = "Co su co xay ra!";
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("QuanLyTaiKhoan.aspx");

        }
    }
}